<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>按钮</button>

  <script>
    function onClick(event) {
      /**
       * 在旧版本的 IE 浏览器，通过 window.event 获取事件对象
       */
      event = event || window.event
      console.log(event)
    }

    document.getElementById('button').onclick = onClick
  </script>
</body>

</html>